<!doctype html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>

<div id="app">
    <button v-on:click="sayHello">click me</button>
</div>


<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script>
    var vm = new Vue({
        el: "#app",
        data: {
            message: 'Hello Vue!'
        },
        methods: { // 方法必须定义在 vue的 Methods对象中, v-on: 事件
            sayHello: function (event) {
                alert(this.message);
            }

        }
    })
</script>

</body>
</html>